package Work;

import java.util.Objects;

/*****登录类*****/

public class Login {
    private String log_id;//编号
    private String username;//用户名
    private String password;//密码
    private String authority;//用户权限
 
    //计数与id分配变量
    private static int count=0;//书本计数
 
    //全参构造
    public Login(String id, String username, String password,String authority) {
 
        this.log_id = id;
        this.username = username;
        this.password = password;
        this.authority = authority;   
    }
 
    public Login() {
    }
 
  //比较判断方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Login Login = (Login) o;
        return username.equals(Login.username);//返回用户名
    }
    
    //toString
    @Override
    public String toString() {
        return "Reader{" +
                "log_id=" + log_id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", authority='" + authority + 
                '}';
    }
    
    public String getID() {
    	return log_id;
    }
    
    public void setID(String id) {
    	this.log_id = id;
    }
    
    public String getName() {
    	return username;
    }
    
    public void setName(String username) {
        this.username = username;
    } 
    
    public String getNumber() {
    	return password;
    }
    
    public void setNumber(String password) {
    	this.password = password;
    }
    
    public String getAuthority() {
    	return authority;
    }
    
    public void setAuthority(String authority) {
    	this.authority = authority;
    }
}

